Conversation
PR Review: feat: support class-level CombinedDataSources with static and method data sourcesSummaryThis PR fixes issue #3990 by removing the ✅ Positives
|
There was a problem hiding this comment.
Pull request overview
This PR enables CombinedDataSourcesAttribute to be used at the class level (on constructor parameters) by removing the IAccessesInstanceData interface implementation. This fixes issue #3990 where class-level usage was blocked by the engine's circular dependency detection.
Key Changes:
- Removed
IAccessesInstanceDatainterface fromCombinedDataSourcesAttributedeclaration - The attribute now delegates instance data access checks to individual nested data source attributes
- Updated public API snapshots across all .NET target frameworks
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| TUnit.TestProject/Bugs/3990/ClassLevelCombinedDataSourcesTests.cs | Comprehensive integration tests covering class-level CombinedDataSources with static Arguments, static MethodDataSource, mixed class/method level usage, and multiple parameters |
| TUnit.Core/Attributes/TestData/CombinedDataSourcesAttribute.cs | Removed IAccessesInstanceData interface implementation; the attribute already checks nested data sources individually for instance access requirements |
| TUnit.PublicAPI/Tests.Core_Library_Has_No_API_Changes.*.verified.txt | Updated public API snapshots for .NET 4.7, 8.0, 9.0, and 10.0 to reflect the interface removal |
…n CombinedDataSourcesAttribute
Pull Request Review - PR #4007SummaryThis PR successfully implements support for class-level CombinedDataSources (issue #3990) by removing the blanket IAccessesInstanceData interface from the attribute and adding runtime validation with improved error messaging. ✅ Strengths1. Excellent Error Message Improvement ⭐The enhanced error message in CombinedDataSourcesAttribute.cs:160-164 is outstanding:
2. Comprehensive Test Coverage ✅The test file demonstrates thorough testing across multiple scenarios:
3. Correct API Change ✅Removing IAccessesInstanceData from CombinedDataSourcesAttribute is the right approach:
4. Code Style Compliance ✅
|
Fixes #3990